package org.example.dao.entity.post;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * (PImage)实体类
 *
 * @author makejava
 * @since 2023-09-14 09:51:56
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PImage  {
    private Long id;
    
    private String url;
    
    private Long postId;
    
    private Date createTime = new Date();

    private Date updateTime = new Date();
    
    private Integer isValid = 1;
    private PImage(Builder builder){
        id = builder.id;
        url = builder.url;
        updateTime = builder.updateTime;
        postId = builder.postId;
        createTime = builder.createTime;
        isValid = builder.isValid;
    }

    public static final class Builder{
        private Long id;

        private String url;

        private Long postId;

        private Date createTime = new Date();

        private Date updateTime = new Date();

        private Integer isValid = 1;
        public Builder id(Long val){
            id = val;
            return this;
        }
        public Builder updateTime(Date val){
            updateTime = val;
            return this;
        }
        public Builder url(String val){
            url = val;
            return this;
        }
        public Builder postId(Long val){
            postId = val;
            return this;
        }
        public Builder createTime(Date val){
            createTime = val;
            return this;
        }
        public Builder isValid(Integer val){
            isValid = val;
            return this;
        }
        public PImage build(){
            return new PImage(this);
        }
    }

}

